#include "iMeshObject.h"

inline iMaxObject::eObjectType iMaxObject::GetObjectType()
{
	switch( GetIGameType() )
	{
	case IGameObject::IGAME_UNKNOWN:
		return eOBJET_UNKNOWN;
	case  IGameObject::IGAME_LIGHT:
		return eOBJET_LIGHT;
	case IGameObject::IGAME_MESH:
		return eOBJET_MESH;
	case IGameObject::IGAME_SPLINE:
		return eOBJET_SPLINE;
	case IGameObject::IGAME_CAMERA:
		return eOBJET_CAMERA;
	case IGameObject::IGAME_HELPER:
		return eOBJET_HELPER;
	case IGameObject::IGAME_BONE:
		return eOBJET_BONE;
	case IGameObject::IGAME_IKCHAIN:
		return eOBJET_IKCHAIN;
	case IGameObject::IGAME_XREF:
		return eOBJET_XREF;
	default:
		return eOBJET_UNKNOWN;
	}
}
inline iMaxObject::eMaxType iMaxObject::GetMexObjectType()
{
	switch( GetMaxType() )
	{
	case IGameObject::IGAME_MAX_UNKNOWN:
		return eMAX_UNKNOWN;
	case  IGameObject::IGAME_MAX_GEOM:
		return eMAX_GEOM;
	case IGameObject::IGAME_MAX_SHAPE:
		return eMAX_SHAPE;
	case IGameObject::IGAME_MAX_LIGHT:
		return eMAX_LIGHT;
	case IGameObject::IGAME_MAX_CAMERA:
		return eMAX_CAMERA;
	case IGameObject::IGAME_MAX_BONE:
		return eMAX_BONE;
	case IGameObject::IGAME_MAX_HELPER:
		return eMAX_HELPER;
	default:
		return eMAX_UNKNOWN;
	}
}

inline bool iMaxObject::GetMeshObject( iMeshObject& pMesh )
{
	switch( GetIGameType() )
	{
	case IGameObject::IGAME_MESH:
		{
			pMesh.m_pMesh = (IGameMesh*)this;
		}
		break;
	case IGameObject::IGAME_HELPER:
		{
			IGameSupportObject * hO = (IGameSupportObject*)this;
			pMesh.m_pMesh = hO->GetMeshObject();
		}
		break;
	case IGameObject::IGAME_BONE:
		{
			IGameSupportObject * hO = (IGameSupportObject*)this;
			pMesh.m_pMesh = hO->GetMeshObject();
		}
		break;
	default:
		return false;
	}
	pMesh.SetMeshType( iMeshObject::eIGAME_TYPE );

	return true;
}

inline int iMaxObject::NumModifiers()
{
	return GetNumModifiers();
}
inline iMaxModifier* iMaxObject::GetModifier( int nIndex )
{
	return (iMaxModifier*)GetIGameModifier( nIndex );
}